import { get, post } from '@/http'
import qs from 'qs'

// 后台用户列表
export function getBackUserListApi(params) {
	return post('/research/api-backUser/list', params)
}
// 菜单列表
export function getMenuListApi(params) {
	return post('/research/api-backMenu/list', params)
}
// 菜单
export function getMenusApi(params) {
	return post('/research/api-backMenu/list-by-user-id', params)
}
// 初始化用户
export function initBackUserApi() {
	return post('/research/api-backUser/init_back_user_info')
}

// 机构
export function getOrgListApi(params) {
	return post('/research/api-admin/research-org-list', params)
}

// 权限
export function getPrivilegesApi(params: Record<string, string>) {
	return get('/research/privileges/check', params)
}
// 前台用户列表
export function getFrontUserListApi(params) {
	return post('/research/api-frontUser/list', params)
}
// 后台按钮
export function getBackMenuListApi(params: any) {
	return post('/research/api-backMenu/list', params)
}

export function getBackMenuByIdApi(id: number) {
	return get('/research/api-backMenu/get', id)
}
export function addBackMenuApi(params: any) {
	return post('/research/api-backMenu/insert', params)
}
export function updateBackMenuApi(params: any) {
	return post('/research/api-backMenu/update', params)
}

export function getBackUserByIdApi(id: number) {
	return get('/research/api-backUser/get-with-auth-by-id', id)
}
export function addBackUserApi(params: any) {
	return post('/research/api-backUser/insert', params)
}
export function updateBackUserApi(params: any) {
	return post('/research/api-backUser/update', params)
}

export function getDicByTypeApi(params: string) {
	return get('/research/api-dic/get-items-by-type', params)
}
export function addDicApi(params: any) {
	return post('/research/api-dic/insert', params)
}
export function updateDicApi(params: any) {
	return post('/research/api-dic/update', params)
}
export function updateDicByTypeApi(params: any) {
	return post('/research/api-dic/update-dic-by-type', params)
}

// 版本信息
export function getVersionByIdApi(id: number) {
	return get('/research/api-admin/version-get', id)
}
//  添加版本信息
export function addVersionApi(params: any) {
	return post('/research/api-admin/version-insert', params)
}
// 更新版本信息
export function updateVersionApi(params: any) {
	return post('/research/api-admin/version-update', params)
}
// 修改密码
export function updatePasswordApi(params: any) {
	console.log('params-----', params)

	return post('/research/api-backUser/update-pwd', params)
}
